package com.frxuexi.mysign

import com.frxuexi.lib_base.http.ApiService
import com.frxuexi.lib_base.mvi.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class MySignViewModel @Inject constructor(val apiService: ApiService):BaseViewModel<MySignIntent>(){
    override fun handlerIntent(it: MySignIntent) {
        when(it){
            is MySignIntent.sign->httpRequest(apiService.addSign(toBody(it.item)))
            is MySignIntent.getMySign->httpRequest(apiService.getSigns(it.uid))
        }
    }
}